package com.roadjava.rbac.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.roadjava.rbac.bean.entity.BannerRes;
import com.roadjava.rbac.bean.entity.IndexRes;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BannerResMapper extends BaseMapper<BannerRes> {
//    @Insert("INSERT INTO banner_res (name, path,link) VALUES (#{name}, #{path},#{link})")
//    void insert(IndexRes indexRes);

    @Select("SELECT * FROM banner_res")
    List<BannerRes> getAllFiles();

    @Select("SELECT * FROM banner_res WHERE id = #{id}")
    IndexRes getFileById(Integer id);

    @Delete("DELETE FROM banner_res WHERE id = #{id}")
    void deleteFileById(Integer id);
    @Select("SELECT * FROM banner_res where type=#{type}")
    List<BannerRes> getImgByType(Integer type);


}
